<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    
    <title>My JSP 'modifyProject.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">

	 <link rel="stylesheet" type="text/css" href="/estate/css/css.css"></link>

<script type="text/javascript" src="/estate/js/calender.js "  ></script>
   <script type="text/javascript" src="/estate/js/lhgcore.js"></script>
	<script type="text/javascript" src="/estate/js/lhgcalendar.js"></script>
		   		<script type="text/javascript" src="/estate/js/jquery-1.2.2.pack.js">
</script>
		<script type="text/javascript" src="/estate/js/json.js">
</script>
		<script type="text/javascript" src="/estate/js/jquery-1.3.min.js">
</script>
	<script type="text/javascript">
	
		J.califrm = true;
		function gotoList()
		{
			window.location.href="modifyProjInPriceAction.action?method=return&currentStage=${modifyList.stage}";
		}
		  function userChange() {
document.getElementById("testdiv").innerHTML="";
	$.get(
		      'priceProjectAction.action?method=leader&leaderId='+document.getElementById("contactUserId").value,
		     null,
		      function(data) //回传函数
		      {
		      	 var list=eval('('+data+')');
		       
		       　for(var i=0;i<list.length;i++){
		       var check=document.createElement("input");
		       var label=document.createElement("label");
		       var br=document.createElement("br");
		       check.setAttribute("id","checkUser");
		      // alert(list[i].name);
		       check.setAttribute("type","checkbox");
				check.setAttribute("value",list[i].id);
				label.setAttribute("id","id"+i);
         		document.getElementById("testdiv").appendChild(check);
         		document.getElementById("testdiv").appendChild(label);
         		document.getElementById("testdiv").appendChild(br);
         		document.getElementById("id"+i).innerHTML=list[i].name;
 　　}
		      });}
		      
		      function submita(id){
		if(document.getElementById("testurl")==null){
			var cbArray = document.getElementsByName("checkUser");
			var userStr = "";
			for(var i = 0;i<cbArray.length;i++){
    			if(cbArray[i].checked){
    				userStr= userStr+cbArray[i].value+",";
    			}
    		}
			window.location.href="/estate/admin/modifyProjInPriceAction.action?method=update&modifyId="+id+"&userStr="+userStr;}
			else window.location.href="modifyProjInPriceAction.action?method=update&modifyId="+id;
	}
	function deleteConfirm(id){
		var question=confirm("确定删除文件吗？");
		if(question!=0){
			window.location.href="fileUploadAction.action?method=pricedelete&deleteId="+id;
		}
	}
	</script>
  </head>
  
  <body>
  <table border="0" cellpadding="0" cellspacing="0" style="background-image:url(/estate/images/gtbg.gif) " width="100%">
    <tr>
      <td width="50%" height="82" rowspan="2"><img src="/estate/images/guide_01.gif"></td>
      <td width="50%" style="background-image:url(/estate/images/guide_02.gif);color:#cc1212; font-size:16px; font-weight:bold; text-align:right; padding-right:50px; letter-spacing:1px; " height="39"><strong>修改项目</strong></td>
    </tr>
     <tr><td width="50%" style="background-image:url(/estate/images/guide_03.gif); height:43px;" align="center" valign="middle">
	  <table width="50%" border="0" cellspacing="0" cellpadding="0">
        <tr align="center">
        </tr>
      </table></td>
    </tr>
</table><br>
       <form action="modifyProjInPriceAction.action?method=update&modifyId=${modifyList.id}" method="post" >
    	<table width="60%" align="center" border="0" cellspacing="0" cellpadding="0" class="main">
    	<tr align="center">
    	<td colspan="4" class="tableTitle">  修改项目  </td>
    	</tr>
  <tr>
    <td width="12%" align="right" class="two">项目编号：</td>
    <td width="18%" align="left" class="two"><input class="input" type="text" name="number" id="number" value="${modifyList.number}" /></td>
    <td width="12%" align="right" class="two">项目名称：</td>
    <td width="18%" align="left" class="two"><input class="input" type="text" name="name" id="name" value="${modifyList.name}" /></td>
  </tr>
  <tr>
    <td align="right" class="two">委托单位：</td>
    <td align="left" class="two"><input type="text" class="input" name="delegateCompany" id="delegateCompany" value="${modifyList.delegateCompany}" /></td>
    <td align="right" class="two">委托单位联系人：</td>
    <td align="left" class="two"><input type="text" class="input" name="delegateUser" id="delegateUser" value="${modifyList.delegateUser}" /></td>
  </tr>
  <tr>
    <td align="right" class="two">委托单位联系人电话：</td>
    <td align="left" class="two"><input type="text" class="input" name="delegatePhone" id="delegatePhone" value="${modifyList.delegatePhone}" /></td>
    <td align="right" class="two">填写人：</td>
    <td align="left" class="two"><input type="text" class="input" name="recordUserId" id="recordUserId" value="${modifyList.recordUserId}" /></td>
  </tr>

  <tr>
    <td align="right" class="two">收到日期：</td>
    <td align="left" class="two"><input class="input" type="text" name="receiveDate" id="receiveDate" value="${modifyList.receiveDate}"  onclick="J.calendar.get();" readonly="readonly"/></td>
    <td align="right" class="two">合同估算价：</td>
    <td align="left" class="two"><input class="input" type="text" name="estimatePrice" id="estimatePrice" value="${modifyList.estimatePrice}"  /></td>
  </tr>
  <tr>
    <td align="right" class="two">送审价：</td>
    <td align="left" class="two"><input class="input" type="text" name="submitPrice" id="submitPrice" value="${modifyList.submitPrice}"  /></td>
    <td align="right" class="two">所属地区：</td>
    <td align="left" class="two"><input class="input" type="text" name="proRegion" id="proRegion" value="${modifyList.proRegion}"  /></td>
  </tr>
  <tr>
    <td align="right" class="two">行业分类：</td>
    <td align="left" class="two"><input class="input" type="text" name="industryCatagory" id="industryCatagory" value="${modifyList.industryCatagory}"  /></td>
    <td align="right" class="two">单位工程名称：</td>
    <td align="left" class="two"><input type="text" class="input" name="proName" id="proName" value="${modifyList.proName}"  /></td>
  </tr>
  <tr>
    <td align="right" class="two">建设单位名称：</td>
    <td align="left" class="two"><input type="text" class="input" name="proCompany" id="proCompany" value="${modifyList.proCompany}"  /></td>
    <td align="right" class="two">建设单位联系人：</td>
    <td align="left" class="two"><input type="text" class="input" name="proContact" id="proContact"  value="${modifyList.proContact}" /></td>
  </tr>
  <tr>
    <td align="right" class="two">建设单位联系人电话：</td>
    <td align="left" class="two"><input type="text" class="input" name="proContactPhone" id="proContactPhone"  value="${modifyList.proContactPhone}" /></td>
    <td align="right" class="two">工作项目分类：</td>
    <td align="left" class="two"><input class="input" type="text" name="workCatagory" id="workCatagory" value="${modifyList.workCatagory}"  /></td>
  </tr>
  <tr>
    
    <td align="right" class="two">下发日期：</td>
    <td colspan="3" align="left" class="two"><input class="select" type="text" name="authorDate" id="authorDate" value="${modifyList.authorDate}"  onclick="J.calendar.get();" readonly="readonly"/></td>

    
  </tr>
  
     <tr>
    <td align="right" class="two">合同ID：</td>
    <td align="left" class="two"><input type="text" class="input" name="contractId" id="contractId" value="${modifyList.contractId}" /></td>
    <td align="right" class="two">咨询组长：</td>
    <td align="left" class="two"><select class="select" name="contactUserId" id="contactUserId" onchange="userChange()">
    <option value="${contactUser.id}">${contactUser.name}</option>
   <optgroup label="请选择咨询人">
    <c:forEach var="contactUserSelect" items="${contactUserSelect}">
    <option value="${contactUserSelect.value}">${contactUserSelect.key}</option>
    
  </c:forEach>
  </optgroup>
    </select></td>
    
  </tr>
    <tr>
 	<td align="right" class="two">咨询组员：	</td>
 	<td align="left" class="two" colspan="3"><div id="testdiv">
 	 <c:forEach var="memberList" items="${memberList}">
    <label>${memberList.name}</label>&nbsp;&nbsp;职责：&nbsp;&nbsp;<label>${memberList.memberJob}</label><br/>
  </c:forEach><a href="#" id="testurl" onclick="userChange()">如需修改请点击</a>
 	</div></td>
  </tr>
    <c:if test="${modifyList.trailState==1}">
<tr>
  <td width="20%"  align="right" class="two">审减率低于20%项目作业计划文件列表：</td>
  <td width="20%"  align="left" class="two" > 
  <c:forEach var="trailPlan" items="${trailPlan}">
    <a href="fileUploadAction.action?method=download&filePath=${trailPlan.filePath}&fileRealName=${trailPlan.fileRealName}">${trailPlan.fileRealName}</a><div style="float:right; cursor:pointer" ><a onclick="deleteConfirm(${trailPlan.id})">删除</a></div><br/>
  </c:forEach></td>
  <td width="20%"  align="right" class="two">审减率低于20%项目会议纪要文件列表：</td>
  <td width="20%"  align="left" class="two" > 
  <c:forEach var="trailSum" items="${trailSum}">
    <a href="fileUploadAction.action?method=download&filePath=${trailSum.filePath}&fileRealName=${trailSum.fileRealName}">${trailSum.fileRealName}</a><div style="float:right; cursor:pointer" ><a onclick="deleteConfirm(${trailSum.id})">删除</a></div><br/>
  </c:forEach></td></tr>
  </c:if>
  <c:if test="${modifyList.isMajor==1}">
<tr>
  <td width="20%"  align="right" class="two">重大项目作业计划文件列表：</td>
  <td width="20%"  align="left" class="two" > 
  <c:forEach var="majorPlan" items="${majorPlan}">
    <a href="fileUploadAction.action?method=download&filePath=${majorPlan.filePath}&fileRealName=${majorPlan.fileRealName}">${majorPlan.fileRealName}</a><div style="float:right; cursor:pointer" ><a onclick="deleteConfirm(${majorPlan.id})">删除</a></div><br/>
  </c:forEach></td>
  <td width="20%"  align="right" class="two">重大项目会议纪要文件列表：</td>
  <td width="20%"  align="left" class="two" > 
  <c:forEach var="majorSum" items="${majorSum}">
    <a href="fileUploadAction.action?method=download&filePath=${majorSum.filePath}&fileRealName=${majorSum.fileRealName}">${majorSum.fileRealName}</a><div style="float:right; cursor:pointer" ><a onclick="deleteConfirm(${majorSum.id})">删除</a></div><br/>
  </c:forEach></td></tr>
  </c:if>
  <tr>
    <td align="right" class="two">备注：</td>
    <td colspan="3" align="left" class="two"><textarea class="textarea" name="remark" id="remark"  cols="45" rows="5">${modifyList.remark}</textarea></td>
  </tr>
  <tr>
 <td colspan="4" class="two" align="center">
  	<input onFocus="this.blur();" style="cursor:pointer" type="button" name="submitButton" class="button4" id="submitButton" onclick="submita(${modifyList.id})" value="保存修改" />&nbsp;&nbsp;
	<input onFocus="this.blur();" style="cursor:pointer" type="button" name="resetButton" id="resetButton" class="button2" onclick="gotoList()" value="返回" />
	</td>
  </tr>
</table>
    </form>
  </body>
</html>
